package com.example.hotelrear.service.impl;

<<<<<<< HEAD
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.hotelrear.entity.Config;
import com.example.hotelrear.mapper.ConfigMapper;
import com.example.hotelrear.service.ConfigService;
=======
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.hotelrear.entity.Config;
import com.example.hotelrear.mapper.ConfigMapper;
import com.example.hotelrear.service.ConfigService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
>>>>>>> c858df565d55deb60e87bd48c878762d1fd5080a
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Base64;
import java.util.List;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author FengXiao
 * @since 2023-08-28
 */
@Service
public class ConfigServiceImpl extends ServiceImpl<ConfigMapper, Config> implements ConfigService {
<<<<<<< HEAD
    @Resource
    private ConfigMapper configMapper;
=======
    @Autowired
    private ConfigMapper configMapper;
    @Override
    public void addConfig(Config config) {
        configMapper.insert(config);
    }

    @Override
    public void deleteConfig(Long id) {
        configMapper.deleteById(id);
    }

    @Override
    public void updateConfig(Config config) {
        configMapper.updateById(config);
    }

    @Override
    public Config getConfigById(Long id) {
        return configMapper.selectById(id);
    }

    @Override
    public List<Config> getAllConfigs() {
        return configMapper.selectList(null);
    }

    @Override
    public int batchDelete(List<Long> ids) {
        return configMapper.deleteBatchIds(ids);
    }

    @Override
    public IPage<Config> selectPage(IPage<Config> page, Integer id) {
        return configMapper.selectPage(page,id);
    }

>>>>>>> c858df565d55deb60e87bd48c878762d1fd5080a


    @Override
    public List<Config> listAll() {
        return configMapper.listAll();
    }
}
